{% extends 'blog/page.html' %}
{% block pagecontent %}
{% load liquidfilters %}
{% for post in paginator.posts %}
<div class="post-preview">
    <a href="{% url 'post' post.posturl %}">
        <h2 class="post-title">            {{ post.title }}
        </h2>
        {% if post.subtitle %}
        <h3 class="post-subtitle">
            {{ post.subtitle }}
        </h3>
        {% endif %}
    </a>
    <p class="post-meta">Posted by {% if post.author %}{{ post.author }}{% else %}{{ site.title }}{% endif %} on {{ post.date | date:'F -d, Y' }}</p>
</div>
<hr>
{% endfor %}

<!-- Pager -->
{% if paginator.pageCount > 1 %}
<nav>
  <ul class="pagination">
    <li {% if not paginator.previous_page %}class="disabled"{% endif %}>
    	<a {% if paginator.previous_page %}href="{% url 'archive' paginator.previous_page_path %}"{% endif %} aria-label="Previous">
    		<span aria-hidden="true">&larr;</span>
    	</a>
    </li>
    {% for i in paginator.pageCount %}
    {% if i == paginator.currentPage %}
    <li class="active"><a>{{ i }}<span class="sr-only">(current)</span></a></li>
    {% else %}
    <li><a href="{% url 'archive' i %}">{{ i }}</a></li>
    {% endif %}
    {% endfor %}
    <li {% if not paginator.next_page %}class="disabled"{% endif %}>
    	<a {% if paginator.next_page %}href="{% url 'archive' paginator.next_page_path %}"{% endif %} aria-label="Next">
    	<span aria-hidden="true">&rarr;</span>
    	</a>
    </li>
  </ul>
</nav>
{% endif %}
{% endblock %}